package kr.hkit.androidcomplete02.ch13;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
import android.widget.TextView;

public class RatingBarEx extends Activity {
	RatingBar mRating;
	TextView mRateText;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_ratingbarex);

		mRating = (RatingBar) findViewById(R.id.ch13_ratingbar);
		mRateText = (TextView) findViewById(R.id.ch13_ratingbar_tv);

		mRating.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
			public void onRatingChanged(RatingBar ratingBar, float rating,
					boolean fromUser) {
				mRateText.setText("Now Rate : " + rating);
			}
		});
	}
}
